package com.zlc.workflow.flow.node;

import com.zlc.workflow.constant.NodeType;
import com.zlc.workflow.flow.TaskModel;

/**
 * <p>
 *
 *   任务节点
 * </p>
 *
 * @author zhanglei
 */
public class TaskNode extends BaseNode implements TaskModel {

    private boolean isFirstTask;

    private boolean isLastTask;

    public TaskNode(String nodeId,String nodeNum, String nodeName) {
        super(nodeId,nodeNum, nodeName);
        this.nodeType = NodeType.TASK;
    }

    public void build(){
        buildPaths(now);
        //构建节点指针
        createNodePointer();
    }

    public void setFirstTask(boolean firstTask) {
        isFirstTask = firstTask;
    }

    public void setLastTask(boolean lastTask) {
        isLastTask = lastTask;
    }

    @Override
    public boolean isFirstTask() {
        return this.isFirstTask;
    }

    @Override
    public boolean isLastTask() {
        return this.isLastTask;
    }
}
